﻿using FreeSql;
namespace Msung.Core.Freesql
{
    /// <summary>
    /// 自定义仓储
    /// </summary>
    public interface IBaseRepositoryCore<TEntity, L> : IBaseRepository<TEntity, L>,
        IDisposable where TEntity : class
    {
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        int ExcuteSql(string sql);
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<int> ExcuteSqlAsync(string sql);
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        int ExcuteSql(TEntity entity);
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<int> ExcuteSqlAsync(TEntity entity);

        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        int ExcuteSql(List<TEntity> entities);
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<int> ExcuteSqlAsync(List<TEntity> entities);
    }
}
